home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 3 / CD ACTUAL 3.iso / linux / incoming / jstools-.6v3 / jstools- / jstools-tk3.6v3.0 / lib / jdoc / jmore.tcl.jdoc < prev    next >
Encoding:
Text File  |  1995-03-14  |  11.2 KB  |  122 lines

  1. {jmore.tcl
  2.  
  3. Introduction
  4. The jmore.tcl library provides procedures for displaying (potentially long) text, such as the contents of a file or the output of a command.  (For short notices, j:alert from the jalert.tcl library may be more appropriate.)
  5.  
  6. The jmore.tcl library is distributed as part of the jstools package.
  7.  
  8. This document describes jmore.tcl version 3.6/3.0.
  9.  
  10. Usage
  11. Accessing the Library
  12. In order to use the jmore.tcl library, it (and any other libraries it depends on) must be in your Tcl auto_path, described in tclvars(n).  Information about how to arrange that, and other conventions common to the jstools libraries, is in the Usage section of The jstools Libraries.
  13.  
  14. Credits and Copyright
  15. Author
  16. Jay Sekora 
  17. js@bu.edu
  18. http://shore.net/~js/
  19.  
  20. Thanks
  21. The code to scroll up and down a page at a time is based on code by Paul Raines <raines@bohr.physics.upenn.edu>.
  22.  
  23. Copyright
  24. The library is copyright ⌐ 1992-1994 by Jay Sekora, but may be freely copied and modified for non¡commercial purposes.  (Please contact me if you want to use it for a commercial purpose, this may be OK under some circumstances.)
  25.  
  26. Overview
  27. Procedures
  28. j:more - display text in window
  29. j:more:pagedown - scroll j:more window down
  30. j:more:pageup - scroll j:more window up
  31. j:more:print - prompt to print the content of a j:more window
  32. j:more:save - prompt to save the content of a j:more window
  33.  
  34. j:more
  35. Usage
  36.     j:more [options]
  37. Options
  38.     -title title  (default {})
  39.     -text text  (default {} - not really optional)
  40.     -height h  (default 24)
  41.     -width w  (default 80)
  42.     -wrap wrap  (default `char')
  43.     -font font  (default `default')
  44.     -class class  (default `More')
  45.  
  46. Example
  47.     set helpFile [open "help.doc"]
  48.     j:more -title "Application Help" -text [read $helpFile]
  49.     close $helpFile
  50.     
  51. Description
  52. This procedure creates a new non¡modal toplevel window with a text widget containing text, a scrollbar, and a set of buttons.  The toplevel will have the title title, and the window class class, which can be used for specifying X resources or window¡manager behaviour.  The text widget will be h lines tall and w characters wide, and its contents will be displayed in the font font.  (If font is `default', then the X Windows default font for the j:more text widget will be used.)  Its lines will be wrapped according to wrap, which can be line, char, or none.
  53.  
  54. The text widget will be disabled, so the user can't alter its contents.  (Unfortunately, this also means that an insertion point won't be displayed, which can make navigating and using the Find panel a little confusing.)
  55.  
  56. Pressing Space, Next or PageDown, or Control-v will scroll the text down, and pressing b, Prior or PageUp, or Escape-v will scroll the text up.
  57.  
  58. Four buttons will appear at the bottom of the window, labelled `Find...', `Print', `Save', and `Done'.
  59.  
  60. Done
  61. `Done' is the default button (i.e., Return will invoke it), and it destroys the window.
  62.  
  63. Save
  64. `Save' lets the user save the contents of the window into a file.
  65.  
  66. Print
  67. `Print' displays a confirmation panel, and, if the user clicks OK, prints the contents of the j:more window to the printer named by the global variable J_PREFS(printer) (or lp if J_PREFS(printer) is not set), using the lpr command.
  68.  
  69. Find...
  70. `Find...' brings up a Find panel that lets you search for a string in the text.
  71.  
  72. The j:more procedure returns the pathname of the text widget, in case the caller wants to further configure it or manipulate its contents.
  73.  
  74. j:more:pagedown
  75. Usage
  76.     j:more:pagedown t
  77.  
  78. This procedure scrolls the j:more text widget t down one windowful.  It's used internally by the j:more procedure and isn't likely to be otherwise useful.  It's based on code by Paul Raines <raines@bohr.physics.upenn.edu>.
  79.  
  80. j:more:pageup
  81. Usage
  82.     j:more:pagedown t
  83.  
  84. Description
  85. This procedure scrolls the j:more text widget t up one windowful.  It's used internally by the j:more procedure and isn't likely to be otherwise useful.  It's based on code by Paul Raines <raines@bohr.physics.upenn.edu>.
  86.  
  87. j:more:print
  88. Usage
  89.     j:more:print t
  90.  
  91. Description
  92. This procedure lets the user print the contents of a j:more panel.  It always asks for confirmation before printing, and uses the printer specified by the global variable J_PREFS(printer), or lp if J_PREFS(printer) is not specified.  It's used internally by the j:more procedure and isn't likely to be otherwise useful.
  93.  
  94. j:more:save
  95. Usage:
  96.     j:more:save t
  97.  
  98. Description
  99. This procedure prompts the user for a filename and saves the contents of the j:more text widget t to the specified file.  It's used internally by the j:more procedure and isn't likely to be otherwise useful.
  100.  
  101. Evolution
  102. Feel free to report bugs (and feature requests) to me, <js@bu.edu>, and I will try to deal with them.  Also, feel free to fix bugs or add features on your own and let me know how you did it.
  103.  
  104. Bugs and Limitations
  105. * Handling of the focus is clumsy; because I wanted the j:more window to be able to to take the focus (so you can use the Next and Prior keys and hit Return to close the window), but I didn't want it to be modal.  This should be much smoother when I'm writing for Tk 4.0.
  106.  
  107. * Using the Find Panel is clumsy under Tk 3, because the insert point isn't visible.
  108.  
  109. Future Directions
  110. * There should be a way to specify which buttons you want on a j:more panel, and to add application¡specific buttons.
  111.  
  112. * I'd like to add options to deal with rich text in some fashion, either by passing in the desired state of the text widget (as specified to j:tag:set_state in jtexttags.tcl) or by passing Tcl code to be evaluated, presumably containing commands from the jrichtext.tcl library.  The latter would be more flexible, because the contents could easily include variable information.
  113.  
  114. * There should be independent global preferences for the size, font, and colour of j:more text widgets.
  115.  
  116. * Interaction with the find panel should be made more intuitive.
  117.  
  118. * There needs to be error checking in j:more:print and j:more:save.
  119.  
  120. Changes
  121. The j:more procedures used to be in a file called jlibrary.tcl.  Starting with version 3.6/2.0, they're in their own independent library.
  122. } {{{display:foreground:Red {12.282 13.0}} {jdoc:xref:link {4.162 4.169 4.179 4.189 6.52 6.59 12.210 12.231 12.239 12.256 12.260 12.281 28.0 28.6 29.0 29.15 30.0 30.13 31.0 31.12 32.0 32.11 112.141 112.156 112.160 112.173 112.255 112.268}} {jdoc:xref:manpage {12.126 12.133}} {jdoc:anchor:anchorname {3.0 4.0 10.0 11.0 14.0 15.0 26.0 27.0 34.0 35.0 74.0 75.0 80.0 81.0 87.0 88.0 94.0 95.0 101.0 102.0}} {richtext:font:roman {2.0 3.0 4.0 4.4 4.13 4.162 4.169 4.179 4.189 6.4 6.13 6.52 6.59 8.24 8.33 10.0 11.21 12.20 12.29 12.102 12.111 12.126 12.133 12.214 12.221 12.243 12.248 12.260 12.281 12.282 13.0 14.0 16.0 17.0 17.9 18.0 18.21 20.0 21.0 21.80 21.111 23.0 24.0 26.0 28.6 29.0 29.15 29.25 29.31 30.0 30.13 30.23 30.29 31.0 31.12 31.48 31.54 32.0 32.11 32.46 32.52 34.0 36.8 36.9 36.16 37.0 38.15 38.24 38.26 39.0 39.13 39.22 39.24 40.0 40.12 40.21 40.23 41.0 41.11 41.20 41.22 42.0 42.13 42.23 42.27 43.0 43.13 43.23 43.30 44.0 44.15 44.25 44.29 46.0 50.0 51.0 52.0 52.85 52.89 52.160 52.165 52.188 52.193 52.294 52.295 52.311 52.312 52.377 52.381 52.397 52.404 52.447 52.453 52.521 52.525 52.540 52.544 52.546 52.550 52.555 52.559 56.9 56.14 56.16 56.20 56.24 56.32 56.37 56.46 56.87 56.88 56.90 56.95 56.99 56.105 56.110 56.118 60.0 61.0 61.36 61.42 63.0 64.0 66.0 67.0 67.94 67.100 67.152 67.168 67.173 67.175 67.179 67.195 67.219 67.222 69.0 70.0 72.4 72.10 74.0 76.18 78.27 78.33 78.46 78.47 78.97 78.103 78.190 78.221 80.0 82.18 84.0 85.0 85.27 85.33 85.46 85.47 85.95 85.101 85.188 85.218 87.0 89.15 91.0 92.0 92.53 92.59 92.171 92.187 92.192 92.194 92.198 92.214 92.262 92.268 94.0 96.14 98.0 99.0 99.77 99.83 99.150 99.156 101.0 102.0 102.55 102.66 104.0 104.20 105.56 105.62 105.122 105.126 105.131 105.136 105.150 105.156 109.0 109.17 110.63 110.69 112.141 112.156 112.160 112.173 112.255 112.268 114.83 114.89 118.38 118.50 118.55 118.66 120.0 121.0 121.4 121.10 121.50 121.62 122.0}} {richtext:font:italic {36.9 36.16 38.8 38.13 39.7 39.11 40.9 40.10 41.8 41.9 42.7 42.11 43.7 43.11 44.8 44.13 52.85 52.89 52.160 52.165 52.188 52.193 52.294 52.295 52.311 52.312 52.377 52.381 52.521 52.525 76.17 76.18 78.46 78.47 82.17 82.18 85.46 85.47 89.14 89.15 96.13 96.14}} {richtext:font:bold {4.4 4.13 4.179 4.189 6.4 6.13 6.52 6.59 8.24 8.33 12.20 12.29 12.214 12.221 56.9 56.14 56.16 56.20 56.24 56.32 56.37 56.46 56.87 56.88 56.90 56.95 56.99 56.105 56.110 56.118 61.36 61.42 105.122 105.126 105.131 105.136 105.150 105.156 112.160 112.173 112.255 112.268 121.50 121.62}} {richtext:font:bolditalic {12.243 12.248 12.260 12.281}} {richtext:font:typewriter {4.162 4.169 12.102 12.111 12.126 12.133 17.0 17.9 18.0 18.21 21.80 21.111 28.0 28.6 29.0 29.15 29.25 29.31 30.0 30.13 30.23 30.29 31.0 31.12 31.48 31.54 32.0 32.11 32.46 32.52 36.0 36.8 38.0 38.8 38.13 38.15 38.24 38.26 39.0 39.7 39.11 39.13 39.22 39.24 40.0 40.9 40.10 40.12 40.21 40.23 41.0 41.8 41.9 41.11 41.20 41.22 42.0 42.7 42.11 42.13 42.23 42.27 43.0 43.7 43.11 43.13 43.23 43.30 44.0 44.8 44.13 44.15 44.25 44.29 47.0 50.0 52.397 52.404 52.447 52.453 52.540 52.544 52.546 52.550 52.555 52.559 67.94 67.100 67.152 67.168 67.173 67.175 67.179 67.195 67.219 67.222 72.4 72.10 76.0 76.17 78.27 78.33 78.97 78.103 78.190 78.221 82.0 82.17 85.27 85.33 85.95 85.101 85.188 85.218 89.0 89.14 92.53 92.59 92.171 92.187 92.192 92.194 92.198 92.214 92.262 92.268 96.0 96.13 99.77 99.83 99.150 99.156 102.55 102.66 105.56 105.62 110.63 110.69 112.141 112.156 114.83 114.89 118.38 118.50 118.55 118.66 121.4 121.10}} {richtext:font:heading0 {1.0 2.0}} {richtext:font:heading1 {3.0 4.0 10.0 11.0 14.0 15.0 26.0 27.0 34.0 35.0 74.0 75.0 80.0 81.0 87.0 88.0 94.0 95.0 101.0 102.0}} {richtext:font:heading2 {11.0 11.21 12.282 13.0 15.0 16.0 20.0 21.0 23.0 24.0 27.0 28.0 35.0 36.0 37.0 38.0 46.0 47.0 51.0 52.0 75.0 76.0 81.0 82.0 84.0 85.0 88.0 89.0 91.0 92.0 95.0 96.0 98.0 99.0 104.0 104.20 109.0 109.17 120.0 121.0}} {richtext:font:heading3 {60.0 61.0 63.0 64.0 66.0 67.0 69.0 70.0}} {{} {12.243 12.256 14.0 19.0 22.0 28.0 34.0 46.0 52.0 60.0 61.1 61.5 61.6 63.0 64.1 64.5 64.6 66.0 67.1 67.6 67.7 69.0 70.1 70.8 70.9 84.0 85.0 87.0}} {jdoc:link:jstools.jdoc {6.52 6.59}} {jdoc:manpage:tclvars {12.126 12.133}} {jdoc:link:jslibraries.jdoc#Usage {12.239 12.256}} {jdoc:link:jslibraries.jdoc {12.260 12.281}} {jdoc:anchorname:Evolution {101.0 102.0}} {jdoc:anchorname:Credits_and_Copyright {14.0 15.0}} {jdoc:anchorname:Introduction {3.0 4.0}} {jdoc:anchorname:Overview {26.0 27.0}} {jdoc:anchorname:Usage {10.0 11.0}} {jdoc:link:jslibraries.tcl {12.210 12.231}} {jdoc:link:jalert.tcl.jdoc#j:alert {4.162 4.169}} {jdoc:link:jalert.tcl.jdoc {4.179 4.189}} {jdoc:link:jrichtext.tcl.jdoc {112.255 112.268}} {jdoc:link:#j:more {28.0 28.6}} {jdoc:link:#j:more:pagedown {29.0 29.15}} {jdoc:link:#j:more:pageup {30.0 30.13}} {jdoc:link:#j:more:print {31.0 31.12}} {jdoc:link:#j:more:save {32.0 32.11}} {jdoc:anchorname:j:more {34.0 35.0}} {jdoc:anchorname:j:more:pagedown {74.0 75.0}} {jdoc:anchorname:j:more:pageup {80.0 81.0}} {jdoc:anchorname:j:more:print {87.0 88.0}} {jdoc:anchorname:j:more:save {94.0 95.0}} {jdoc:link:jtexttags.tcl.jdoc {112.160 112.173}} {jdoc:link:jtexttags.tcl.jdoc#j:tag:set_state {112.141 112.156}}} {{abbrevstart 113.0} {matchend 122.0} {del_from 122.0} {richptr 13.0} {abbrevend 113.0} {insert 8.49} {emacs_mark 122.0} {anchor 8.49} {matchstart 122.0} {del_to 122.0} {current 1.9}}}